function [CP]= periodicStim_TCSII(t1, t2, np, p) 

    %t1: target temp 1 in tenth of °C
    %t2: target temp 2
    %np: number of periods
    %p:  period duration
 
    pp=round((.5+sin(-pi/2-(2*pi)/19*(0:19))/2)*(t2-t1)+t1); %generate 1 sine
    tb=100*p/length(pp); % time bin length in 10ms
    
    % generating the serie of numbers corresponding to 1 period (each group
    % of 6 correspond to 1 time point
    period={};
    period(1:2:2*length(pp))={sprintf('%03d',tb)};
    for i=2:2:2*length(pp)
    period(i)={sprintf('%d',pp(i/2))};
    end
    %making the period array a period string
    P=[];
    for i=1:length(period)
        P=[P char(period(i))];
    end
    
    NumPairs=length(pp)*np; % computing the number of defined time points 
    h=['Uw11111' sprintf('%03d',NumPairs)]; %setting the head of the command  
    AllP=repmat(P,1,np); %creating a string wigh all the periods
    CP=[h AllP];   %assembling the head and periods strings
      